package com.hero.jobweb.action.tag;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ComponentTagSupport;

import com.opensymphony.xwork2.util.ValueStack;

public class JobWebShowCodeTag extends ComponentTagSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String code;
	private String levelSep = "--";// 有上下级关系的分隔符标志
	private boolean showParentName = false;// 默认显示上级名称
	private String mapMethodName;
	public String getLevelSep() {
		return levelSep;
	}
	public void setLevelSep(String levelSep) {
		this.levelSep = levelSep;
	}
	public boolean isShowParentName() {
		return showParentName;
	}
	public void setShowParentName(boolean showParentName) {
		this.showParentName = showParentName;
	}
	public String getMapMethodName() {
		return mapMethodName;
	}
	public void setMapMethodName(String mapMethodName) {
		this.mapMethodName = mapMethodName;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}

	@Override
	protected void populateParams() {
		super.populateParams();
		JobWebShowCodeComponent jobWebShowCodeComp=(JobWebShowCodeComponent) getComponent();
		jobWebShowCodeComp.setCode(getCode());
		jobWebShowCodeComp.setLevelSep(levelSep);
		jobWebShowCodeComp.setMapMethodName(mapMethodName);
		jobWebShowCodeComp.setShowParentName(showParentName);
	}
	@Override
	public Component getBean(ValueStack stack, HttpServletRequest request,
			HttpServletResponse response) {
		return new JobWebShowCodeComponent(stack);
	}
}
